// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import store from './store'
import './sass/index.scss';


import api from './axios/api'

Vue.prototype.API= api


Vue.config.productionTip = false
Vue.use(MintUI)

Vue.prototype.HOST = '/mark'

//时间格式转换
Vue.filter('timenyr',(v,i,s)=>{
  if (!v) { return ''}
  v = new Date(parseInt(v) * 1000).toLocaleString().substr(0,17);
  return v
})
//时间格式转换
Vue.filter('timeEnd',(t)=>{
  if(!t){return ''}
  var d = new Date(t);
  var youWant=d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
  return youWant
})
Vue.filter('substring',(v,i,s)=>{
  if (!v) { return ''}
  v = v.substring(0,5)+'**********'+ v.substring(v.length-4,v.length)
  return v
})
import {_http} from './axios/http'

Vue.prototype.$http = _http
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: { App }
})
